home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
LOGIC Apps
/
Logic-APPLE_II_APPS.iso
/
mac
/
LOGIC Apple II 5.25" Library - DOS Part 1
/
DOS022.dsk
/
FORT.bas
< prev
next >
Wrap
BASIC Source File
|
2012-02-16
|
10KB
|
265 lines
10 M = 140:I = 1600:C = 4:D = 3:B = 2300:C(1) = 5:C(2) = 5:C(3) = 5:C(4) = 5:C1 = 20
15 M(1) = 30:M(2) = 30:M(3) = 30:M(4) = 30:I(1) = 400:I(2) = 400:I(3) = 400:I(4) = 400
20 F(1) = 150:F(2) = 150:F(3) = 150:F(4) = 150
25 PRINT CHR$(12)
27 HOME
30 PRINT "DO YOU NEED INSTRUCTIONS ?": GET A$
35 IF A$ = "N" THEN 195
40 HOME : PRINT TAB( 10)"INSTRUCTIONS FOR :"
45 PRINT : PRINT TAB( 15)"*FORT*"
50 PRINT : PRINT : PRINT
55 PRINT "YOU ARE THE GENERAL OF F-TROOP AND"
60 PRINT "THE HECKAWEES INDIANS ARE ON THE"
62 PRINT "WARPATH. YOU MUST HOLD THE FORT FOR"
65 PRINT "3 DAYS (10 COMMANDS). IN ORDER FOR"
70 PRINT "THE 7TH CAVALRY TO ARRIVE WITH"
72 PRINT "REINFORCEMENTS TO SAVE THE WEST"
75 PRINT "FROM THE INDIANS. THERE ARE 1600"
80 PRINT "INDIANS SPLIT UP SO THAT 400 INDIANS"
82 PRINT "ARE ON EACH SIDE. YOU HAVE 120 MEN"
85 PRINT "PLACED SO THAT THERE ARE 30 MEN ON"
87 PRINT "EACH SIDE. THERE IS ONE CANNON PER"
90 PRINT "SIDE AND EACH HAS 5 CANNONBALLS. YOU"
92 PRINT "ALSO START WITH 2300 ROUNDS OF AMMO."
95 PRINT : PRINT : PRINT "HIT SPACE BAR TO CONTINUE": GET A$
100 HOME : PRINT "YOUR COMMANDS ARE:"
105 PRINT : PRINT "(1)" TAB( 05)"THIS COMMAND ALLOWS YOU TO ATTACK"
107 PRINT TAB( 05)"THE INDIANS. IN A SINGLE TURN YOU"
110 PRINT TAB( 05)"MAY ATTACK 1-4 SIDES WITH EITHER"
112 PRINT TAB( 05)"RIFLES OF CANNONS. YOU MAY NOT"
115 PRINT TAB( 05)"ATTACK THE SAME SIDE MORE THAN"
120 PRINT TAB( 05)"ONCE DURING THE 'ATTACK' TURN."
125 PRINT
130 PRINT "(2)" TAB( 05)"THIS COMMAND ALLOWS YOU TO"
132 PRINT TAB( 05)"MOVE MEN OR CANNONBALLS FROM"
135 PRINT TAB( 05)"ONE SIDE TO ANOTHER. REMEMBER: "
140 PRINT TAB( 05)"WHEN YOU MOVE YOUR MEN THE"
145 PRINT TAB( 05)"INDIANS ARE GOING TO MOVE CLOSER"
147 PRINT TAB( 05)"TO THE FORT."
150 PRINT
155 PRINT "(3)" TAB( 05)"THIS COMMAND GIVES YOU A STATUS"
160 PRINT TAB( 05)"REPORT -- NUMBER OF INDIANS, MEN"
165 PRINT TAB( 05)"AND CANNONBALLS, AS WELL AS THEIR"
170 PRINT TAB( 05)"LOCATIONS. IT ALSO SHOWS: THE"
175 PRINT TAB( 05)"DISTANCE THE INDIANS ARE AWAY FROM"
178 PRINT TAB( 05)"THE FORT AND THE TOTAL AMMO LEFT."
179 PRINT : PRINT "HIT SPACEBAR TO CONTINUE";: GET A$: HOME : PRINT TAB( 15)"COMMANDS": PRINT
180 PRINT "(3)" TAB( 05)"(CONTINUED) USING THIS COMMAND"
182 PRINT TAB( 05)"DOES NOT USE UP ANY OF YOUR TEN"
183 PRINT TAB( 05)"COMMANDS."
184 PRINT : PRINT "(4)" TAB( 05)"THIS ALLOWS YOU TO SURRENDER"
185 PRINT
186 PRINT "(5)" TAB( 05)"THIS GETS YOU A NEW GAME"
187 PRINT
188 PRINT "(6)" TAB( 05)"THIS PRINTS A CONCISE LIST OF"
189 PRINT TAB( 05)"COMMANDS. THIS DOES NOT USE UP"
190 PRINT TAB( 05)"ONE OF YOUR TEN COMMANDS."
195 PRINT : PRINT : INPUT "PLEASE ENTER YOUR LAST NAME:";A$(1)
200 PRINT
205 IF I(1) +I(2) +I(3) +I(4) <1 THEN 1620
210 PRINT "WHAT IS YOUR COMMAND, GENERAL ";A$(1)
215 PRINT
220 INPUT S:D = INT(10 *(D -.3))/10: IF S < >3 AND D = 0 THEN 1520
225 FOR X = 1 TO 4:T5(X) = 0: NEXT
230 ON S GOTO 300,500,700,1800,1750,1850
240 REM 1=ATTACK 2=MOVE 3=STATUS
300 REM FOR ATTACK
305 PRINT : PRINT
306 INPUT "HOW MANY SIDES DO YOU WANT TO ATTACK?";P: IF P >4 THEN 1190
308 FOR Q = 1 TO P
309 PRINT "THIS IS ATTACK NUMBER "Q
310 PRINT "CANNON (1) OR RIFLES (2) ";: INPUT A: IF A = 0 THEN 205
320 IF A = 2 THEN 400
325 REM FOR CANNON ATTACK
330 PRINT "WHICH CANNON ";: INPUT C2
332 IF C2 = 0 THEN 309
333 IF C(C2) = 0 THEN 395
335 IF C(C2) = 0 THEN 395
340 PRINT "HOW MANY CANNONBALLS ";: INPUT K1: IF K1 = 0 THEN 309
345 IF C(C2) <K1 THEN PRINT "YOU DON'T HAVE THAT MANY."
347 IF C(C2) <K1 THEN 340
350 REM ONE CANNONBALL KILLS 15 INDIANS
353 K(Q) = 15 *K1
355 IF I(C2) <0 THEN I(C2) = 0
356 IF I(C2) -K(Q) <0 THEN K(Q) = I(C2)
360 C(C2) = C(C2) -K1:I = I -K(Q):I(C2) = I(C2) -K(Q):C1 = C1 -K1
380 PRINT "THOSE SHOTS KILLED "K(Q)" INDIANS": PRINT : PRINT
390 GOTO 470
395 PRINT "YOU DON'T HAVE ANY CANNONBALLS LEFT ON THAT SIDE"
397 GOTO 470
398 PRINT "THERE'S NO ONE THERE TO FIRE"
399 GOTO 470
400 REM FOR RIFLES
410 INPUT "WHICH SIDE ";S1
411 IF S1 = 0 THEN 205
412 T5(S1) = T5(S1) +1
413 IF T5(S1) = 2 THEN 1170
420 INPUT "HOW MANY ROUNDS ";R
422 X = M(S1) *10
423 IF R >X THEN 1200
425 IF R >B THEN 1205
426 B = B -R
430 K(Q) = INT( RND(0) *(.8 *R)) +1
432 IF K(Q) >I(S1) THEN K(Q) = I(S1)
440 IF K(Q) <R/2 THEN 430
450 I(S1) = I(S1) -K(Q)
460 PRINT "YOU HAVE KILLED "K(Q)" INDIANS": PRINT : PRINT
465 IF I(1) +I(2) +I(3) +I(4) = 0 THEN 1620
470 NEXT Q
480 GOTO 1210
500 REM TO MOVE MEN
505 PRINT : PRINT
510 INPUT "DO YOU WANT TO MOVE MEN (1) OR CANNONBALLS (2) ";M
515 IF M = 0 THEN 205
520 IF M = 2 THEN 600
530 INPUT "HOW MANY MEN ";N
535 IF N = 0 THEN 205:D = D -.3
540 INPUT "FROM WHERE? ";S1
541 INPUT "TO WHERE? ";S2
542 IF S1 = 0 OR S2 = 0 THEN 205
543 IF M(S1) <N THEN PRINT "YOU DON'T HAVE THAT MANY MEN"
545 IF M(S1) <N THEN 530
550 M(S1) = M(S1) -N:M(S2) = M(S2) +N
560 PRINT "SIDE "S1" NOW HAS "M(S1)" MEN AND"
570 PRINT "SIDE "S2" NOW HAS "M(S2)" MEN."
580 GOTO 1700
599 REM TO MOVE CANNONBALLS
600 INPUT "FROM CANNON ";C2: INPUT "TO CANNON ";C3: IF C2 = 0 THEN 205: IF C3 = 0 THEN 205
610 INPUT "HOW MANY BALLS ";X: IF X = 0 THEN 205
620 IF X >C(C2) THEN PRINT "THERE ARE ONLY "C(C2)" BALLS THERE."
630 IF X >C(C2) THEN 610
640 C(C2) = C(C2) -X
650 C(C3) = C(C3) +X
660 GOTO 205
700 REM FOR STATUS
705 IF D < >3 THEN D = D +.3
706 HOME
707 PRINT : PRINT " S T A T U S R E P O R T "
710 PRINT "SIDE #" TAB( 10)"INDIANS #" TAB( 21)"MEN #" TAB( 28)"CANNONBALL #"
712 I = I(1) +I(2) +I(3) +I(4)
715 M = M(1) +M(2) +M(3) +M(4): FOR X = 1 TO 4: IF I(X) <1 THEN F(X) = 0
717 NEXT X
720 FOR X = 1 TO 4
730 PRINT TAB( 02)X TAB( 12)I(X) TAB( 22)M(X) TAB( 32)C(X): NEXT X
740 PRINT : PRINT "TOTALS" TAB( 12)I TAB( 22)M TAB( 32)C1
750 PRINT : PRINT : PRINT "YOU HAVE:"
760 PRINT TAB( 5)B" BULLETS": PRINT TAB( 5)"AND "D" DAYS LEFT"
764 PRINT : PRINT : PRINT : PRINT : PRINT : PRINT "HIT SPACEBAR TO CONTINUE";: GET A$: HOME : PRINT TAB( 15)"LAYOUT OF FORT"
765 PRINT : PRINT TAB( 19)F(1)
770 PRINT TAB( 19)I(1)
775 PRINT
780 PRINT TAB( 05);: FOR X = 1 TO 30: PRINT "*";: NEXT
785 PRINT
790 PRINT TAB( 5)"*"; TAB( 19)M(1); TAB( 34)"*"
795 FOR X = 1 TO 3
800 PRINT TAB( 5)"*" TAB( 34)"*"
810 NEXT
815 PRINT F(2); TAB( 5)"*"; TAB( 34)"*"; TAB( 37)F(4)
820 PRINT I(2) TAB( 05)"* ";M(2); TAB( 15)"F-TROOP"; TAB( 30)M(4); TAB( 34)"*" TAB( 37)I(4)
830 FOR X = 1 TO 3: PRINT TAB( 5)"*" TAB( 34)"*": NEXT
840 PRINT TAB( 5)"*"; TAB( 19)M(3); TAB( 34)"*"
850 PRINT TAB( 05): FOR X = 1 TO 30: PRINT "*";: NEXT
855 PRINT
856 PRINT
860 PRINT TAB( 19)I(3)
865 PRINT TAB( 19)F(3)
866 PRINT : PRINT : PRINT "HIT SPACEBAR TO CONTINUE";: GET A$
870 HOME : GOTO 205
1170 PRINT " YOU ALREADY SHOT ON THAT SIDE": GOTO 410
1190 PRINT " YOU CAN'T ATTACK THAT MANY SIDES": GOTO 306
1200 PRINT " YOU DON'T HAVE THAT MANY ROUNDS": GOTO 420
1205 PRINT " YOU DON'T HAVE THAT MANY BULLETS LEFT": GOTO 410
1210 REM FOR INDIAN ATTACK
1215 FOR X = 1 TO 4
1217 IF M(X) = 0 THEN 1285
1218 IF I(X) <1 THEN 1495
1220 O = INT(I(X)/M(X))
1230 S3(X) = INT( RND(0) *O) +1
1240 S3(X) = INT(S3(X) +5)
1250 IF S3(X) = 1 THEN S3(X) = 0
1255 IF S3(X) > = M(X) THEN S3(X) = M(X)
1260 PRINT "SIDE NUMBER "X;
1265 IF M(X) >0 THEN PRINT " LOST "S3(X)" MEN"
1270 M(X) = M(X) -S3(X)
1280 IF M(X) <0 THEN M(X) = 0
1285 IF M(1) +M(2) +M(3) +M(4) <1 THEN 1590: IF I(X) <1 THEN 1495
1286 IF I(X) <1 THEN 1495
1290 F5 = S3(X) *8
1291 IF K(X) >150 THEN F(X) = F(X) +40
1292 F(X) = F(X) -F5
1295 H = INT( RND(0) *50) +1
1296 IF I(X) <1 THEN 1495
1297 IF M(X) = 0 THEN F(X) = F(X) -H
1298 IF I(X) <1 THEN F(X) = 0
1299 IF F(X) <0 THEN 1301
1300 GOTO 1485
1301 PRINT "THE INDIANS ARE COMING INTO THE FORT"
1305 PRINT " ON SIDE "X" !!!"
1310 P = INT( RND(0) *M(X)) +1
1320 M(X) = M(X) -P:I(X) = I(X) -(P *2)
1330 IF I(X) <15 THEN 1400
1350 M(X) = 0: PRINT "ALL THE MEN ON SIDE ";X;" HAVE BEEN KILLED!"
1360 PRINT " THERE ARE ";I(X);" INDIANS IN THE FORT!"
1370 P = INT( RND(0) *I(X)) +1:P = P *.5:P = P/4
1380 FOR T = 1 TO 4:M(T) = INT(M(T) -P)
1385 IF M(T) <0 THEN M(T) = 0: NEXT T
1387 IF M(1) +M(2) +M(3) +M(4) = 0 THEN 1600
1390 FOR T = 1 TO 4: PRINT " THERE ARE NOW ";M(T);" MEN ON SIDE ";T
1393 IF M(1) +M(2) +M(3) +M(4) = 0 THEN 1600
1395 NEXT T
1400 I(X) = I(X) -10: PRINT " THE INDIANS ON SIDE ";X;" HAVE BEEN PUSHED OUT"
1405 IF I(X) <0 THEN I(X) = 0
1410 PRINT " THERE'S ";I(X);" INDIANS ON THAT SIDE":F(X) = 150
1413 IF F(X) <1 THEN F(X) = 0
1415 GOTO 1485
1420 PRINT " THE INDIANS HAVE COME IN ON SIDE ";X
1485 IF I(X) <1 THEN F(X) = 0
1490 PRINT " THE INDIANS ARE ";F(X);" FEET AWAY FROM THE FORT": PRINT
1492 IF I(1) +I(2) +I(3) +I(4) <1 THEN 1620
1495 IF P1 = 2 THEN 1730
1500 NEXT X
1507 GOTO 205
1510 REM POSSIBL;E ENDINGS
1515 HOME
1520 PRINT : PRINT : PRINT : PRINT "WAIT A MINUTE!!!!!!!! HERE COMES THE"
1525 PRINT "CABALRY TO THE RESCUE!!!!!!!"
1530 PRINT " H H H U U U R R R A A A Y Y Y": PRINT
1540 PRINT "THANKS, GENERAL. YOU HELD THE FORT FROM"
1542 PRINT "THE INDIANS AND SAVED THE WEST!"
1550 PRINT "NOW ALL MEN CAN LIVE IN PEACE, HARMONY"
1555 PRINT "LOVE AND BROTHERHOOD."
1560 PRINT : PRINT : PRINT TAB( 35)"AMEN"
1580 GOTO 2046
1590 PRINT : PRINT
1595 HOME
1600 PRINT CHR$(12): PRINT " YOU LOST ALL YOUR MEN."
1610 PRINT "GOT TAKE A SHOWER."
1615 GOTO 2046
1620 HOME : PRINT "YOU KILLED ALL THE INDIANS.": GOTO 1530
1630 STOP
1699 REM DETERMINES DISTANCE OF INDS
1700 FOR X = 1 TO 4
1710 H = INT( RND(0) *50) +1
1720 F(X) = F(X) -H
1722 P1 = 2: IF I(X) <1 THEN 1730
1725 IF F(X) <1 THEN 1300
1730 P1 = 0: NEXT X
1740 GOTO 205
1749 REM FOR NEW GAME
1750 PRINT "OKAY, CHICKEN ... YOUR NEW GAME STARTS"
1752 PRINT "IN A FEW SECONDS."
1755 FOR L = 1 TO 5000: NEXT
1760 GOTO 10
1799 REM SURRENDER
1800 PRINT "YOU YELLOW BELLIED SAP SUCKER!!!!"
1805 PRINT "THE INDIANS HAVE TAKEN OVER THE FORT"
1810 PRINT "AND YOU'VE GIVEN THEM A CHANCE TO TAKE"
1812 PRINT "OVER THE WHOLE WIDE WEST"
1815 PRINT : PRINT : PRINT : PRINT : PRINT " P.S. YOU HAVE BEEN SCALPED!"
1820 GOTO 2046
1840 REM COMMANDS
1850 PRINT "(1) ATTACK": PRINT "(2) MOVE MEN/CANNONBALLS": PRINT "(3) STATUS REPORT": PRINT "(4) SURRENDER": PRINT "(5) NEW GAME"
1860 PRINT "(6) LIST OF COMMANDS"
1875 D = D +.3
1880 GOTO 205
2046 END